package com.sghd.fight.module.game.service.skill.alter;


import com.sghd.fight.module.game.core.model.Unit;
import com.sghd.pojo.fight.game.UnitValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 战斗单位的{@link UnitValue}值修改器
 */
public class UnitValueAlter extends IntegerTemplate {
    private Logger logger = LoggerFactory.getLogger(getClass());
    /** 修改类型 */
    private UnitValue type;

    public UnitValueAlter(UnitValue type) {
        this.type = type;
    }

    @Override
    public void execute(Unit unit, Integer value) {
        unit.increaseValue(type, value);
        logger.debug(unit.getName() + "当前HP:" + unit.getValue(UnitValue.HP));
    }
}